package com.swust.exam.controller;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;


import com.swust.exam.pojo.Classes;
import com.swust.exam.service.ClassesService;


@RestController
public class ClassesController {
	@Autowired
	private ClassesService classesService;
	
	
	@GetMapping(value = "/classes/get")
	public Classes classesGet(int id)
	{
		return classesService.get(id);
	}
	
	
	@DeleteMapping(value="/classes/delete")
	public int classesDelete(int id) {
		return classesService.delete(id);
	}
	
	@PostMapping(value="/classes/insert")
	public int classesInsert(Classes classes) {
		return classesService.insert(classes);
	}
	
	@PutMapping(value="/classes/update")
	public int classesUpdate(Classes classes) {
		return classesService.update(classes);
	}

}
